<template>
  <div @click="toTaobao(item.goodId)" @mouseenter.stop="mouseenter" @mouseleave="mouseleave" class="list_item">
    <div class="imgBox">
      <a href="javascript:void (0)">
        <img class="" v-lazy="item.mainPic">
      </a>
    </div>
    <div class="quan_item_con">
      <div class="item-title">{{item.name}}</div>
      <div class="price clearfix">
        <!--*******************************-->
        <!--item.priceAfterCoupon >=0-->
        <div class="fl" v-show="item.priceAfterCoupon>=0">
          <span class="pir">¥</span>
          <span class="num">{{ item.priceAfterCoupon | getCount}}</span>
          <span class="pri_font">券后价</span>
        </div>
        <!--item.priceAfterCouon<0 -->
        <div class="fl" v-show="item.priceAfterCoupon<0">
          <span class="pir">¥</span>
          <span class="num">{{ item.price | getCount}}</span>
          <span class="pri_font">{{item.couponInfo}}</span>
        </div>
        <!--*************************-->
        <span class="list fr">{{item.couponUse}}人已领</span>
      </div>
      <div class="item_btn_box clearfix">
        <div class="fl">
          <div class="quan_number">
            <span class="quan_tip">券</span><span class="quan_price">{{item.couponValue}}元</span>
          </div>
        </div>
        <a v-show="true"  class="quan_button fr " href="javascript:void (0)">领券抢购</a>
        <div v-show="false"  class="mall_tm fr">
          <span class="icons"></span>
          <span class="text" ></span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import {GETCHANGELINK} from 'src/const/uri'
  export default{
    props:{
      item:{
        type:Object,
        default:{}
      }
    },
    data(){
      return {
        toggle:false,
      }
    },
    methods:{
      mouseenter(){
        this.toggle=true;
      },
      mouseleave(){
        this.toggle=false;
      },
        toTaobao(item){
            console.log(item);
            this.$ajax.get(GETCHANGELINK,{
                goodId: item,
                promotionTypeId: 1
            },(res)=>{
                window.open(res.data.tbkCouponLink);
            });
            //window.open(item);
        }
    }
  }
</script>
<style lang="less">
  .list_item{
    position: relative;
    width: 265px;
    height: 376px;
    margin-bottom: 15px;
    background-color: #fff;
    -webkit-transition: border .6s;
    -ms-transition: border .6s;
    -o-transition: border .6s;
    transition: border .6s;
    border: 2px solid #f5f5f5;
    cursor: pointer;
    &:hover{
      border: 2px solid #f54e54;
    }
    .imgBox{
      >a{
        img {
          width: 261px;
          height: 261px;
        }
      }
    }
    .quan_item_con{
      padding: 0 10px 11px 10px;
      .item-title{
        padding: 5px 0 2px 0;
        font-size: 14px;
        overflow: hidden;
        word-break: keep-all;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
      .price{
        /*margin-top: 22px;*/
        color: #f24f60;
        height: 30px;
        >.fl{
          .pir{
            font-size: 12px;
            color:@themeColor;
          }
          .num{
            margin-left: 3px;
            line-height: 30px;
            font-size: 26px;
            font-family: arial;
            position: relative;
            top: 1px;
          }
          .pri_font{
            padding: 0 12px 0 3px;
            color: #a6a4b2;
          }
        }
        >.list{
          margin-top: 10px;
          color: #a6a4b2;
        }
      }
      .item_btn_box{
        margin-top: 10px;
        .fl{
          .quan_number{
            height: 18px;
            margin-top: 7px;
            color: #f54e54;
            border: 1px solid #f54e54;
            border-radius: 2px;
            line-height: 18px;
            .quan_tip{
              display: inline-block;
              width: 20px;
              text-align: center;
              background-color: #f54e54;
              color: #fff;
            }
            .quan_price{
              padding: 0 5px;
            }
          }
        }
        .quan_button{
          display: inline-block;
          width: 80px;
          line-height: 32px;
          height: 32px;
          font-size: 14px;
          color: #fff;
          background-color: #f54e54;
          text-align: center;
          border-radius: 3px;
          &:hover{
            background-color: #f7656a;
            color:#fff
          }
        }
        .mall_tm{
          font-size: 12px;
          margin-top: 8px;
          display: inline-block;
          color: #c40000;
          .icons{
            display: inline-block;
            width: 15px;
            height: 15px;
            background: url(https://i.huim.com/content_new/images/souquan_ico.png) no-repeat -69px 0;
            vertical-align: middle;
          }
          span.text{
            display: inline-block;
            vertical-align: middle;
          }
        }
      }
    }
  }
</style>
